package cn.com.mybaits.type.impl;


import cn.com.mybaits.type.ParamType;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 字符串参数类型
 *
 * @author LiuGuodong
 * @date 2023/09/27
 */
public class StringParamType implements ParamType<String> {

    @Override
    public void setParameter(PreparedStatement statement, String paramValue, Integer index) throws SQLException {
        statement.setString(index, paramValue);
    }

    @Override
    public String getParameter(ResultSet resultSet, String paramValue) throws SQLException {
        return resultSet.getString(paramValue);
    }
}
